<script setup>
import { RouterView } from 'vue-router'
import Aside from './views/AsideView.vue'
</script>

<template>
  <div class="common-layout">
    <el-container>
      <el-aside>
        <div class="logo-area">LOGO区域</div>

        <div class="nav-container">
          <Aside />
        </div>
      </el-aside>

      <el-container>
        <el-header>头部</el-header>
        <!-- 内容区域展示 -->
        <el-main>
          <RouterView />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<style scoped>
.common-layout {
  width: 100vw;
  height: 100vh;
}

/*导航栏  */
.el-aside {
  width: 220px;
  height: calc(100vh - 100px);
  /* background-color: rgb(148, 150, 150); */
  margin-top: 100px; /* 抵消LOGO区域占用的空间 */
  border-right: 1px solid red;
}

/* 新增LOGO区域样式 */
.logo-area {
  width: 220px;
  height: 100px;
  background-color: rgb(37, 150, 88);
  position: fixed; /* 改为固定定位 */
  top: 0;
  left: 0;
  z-index: 1000; /* 确保在最上层 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 可选：添加阴影增强视觉效果 */
}

/* 新增导航容器样式 */
.nav-container {
  height: calc(100vh - 100px); /* 视口高度减去LOGO区域高度 */
  overflow-y: auto; /* 允许垂直滚动 */
  overflow-x: hidden; /* 禁止水平滚动 */
  scrollbar-width: none; /* Firefox隐藏滚动条 */
  -ms-overflow-style: none; /* IE/Edge隐藏滚动条 */
}

/* Chrome/Safari隐藏滚动条 */
.nav-container::-webkit-scrollbar {
  display: none;
}

.el-container {
  width: calc(100vw - 220px);
  height: 100vh;
  /* background-color: blue; */
}

.el-header {
  width: calc(100vw - 220px);
  height: 100px;
  background-color: rgb(191, 179, 162);
}

.el-main {
  width: calc(100vw - 220px);
  /* background-color: rgb(85, 87, 84); */
}
</style>
